extends ../layout

block content
	.banner
		.swiper-container
			.swiper-wrapper
				.swiper-slide
					img(src="http://image13.m1905.cn/uploadfile/2017/0603/thumb_1_1380_460_20170603092342254455.jpg")
				.swiper-slide
					img(src="http://image14.m1905.cn/uploadfile/2017/0602/thumb_1_1380_460_20170602051052200160.jpg")
				.swiper-slide
					img(src="http://image13.m1905.cn/uploadfile/2017/0602/thumb_1_1380_460_20170602090928417999.jpg")
				.swiper-slide
					img(src="http://image13.m1905.cn/uploadfile/2017/0524/thumb_1_1380_460_20170524022351345629.jpg")
				.swiper-slide
					img(src="http://image13.m1905.cn/uploadfile/2017/0608/thumb_1_1380_460_20170608034752768383.jpg")
			.swiper-pagination
	.container
		.row
			//-.page-header.clearfix
				.col-md-4
					small 电影首页
				.col-md-8
					form(method="GET", action="/results")
						.input-group.col-sm-4.pull-right
							input.form-control(type="text", name="q")
							span.input-group-btn
								button.btn.btn-default(type="submit") 搜索
			each cat in categories
				.panel.panel-default.no-border
					.panel-heading.no-border
						h4
							a(href="/results?cat=#{cat._id}&p=0") #{cat.name}
					.panel-body
						if cat.movies && cat.movies.length > 0							
							each item in cat.movies
								.col-md-2
									.thumbnail
										a(href="/movie/#{item._id}")
											if item.poster.indexOf('https:') > -1
												img(src="#{item.poster}", alt="#{item.title}")
											else
												img(src="/upload/#{item.poster}", alt="#{item.title}")
										.caption
											h5.text-ov #{item.title}
											p.text-ov(style="color: orange; font-size: 12px;")
												if item.average == 0
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
												if item.average > 0 && item.average < 5 
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
												else if item.average >= 5 && item.average < 7
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star-empty
													span.glyphicon.glyphicon-star-empty
												else if item.average >= 7 && item.average < 9
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star-empty
												else if item.average >= 9
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star
													span.glyphicon.glyphicon-star

												i(style="color: red; padding-left: 8px;") #{item.average}
											p.text-ov: button.btn.btn-primary.btn-xs(href="/movie/#{item._id}", role="button") 查看详情
	.footer
		.container
			.row
				p.footer-text CopyRight © 2017
					span &nbsp;&nbsp;KKMM电影网  
					span.pull-right 技术支持：Lemon@nodeJS